package cn.zane.common.exception;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @Author: zane
 * @Date: 2025/04/05
 * @Description: 自定义异常
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class AppException extends RuntimeException {

    /**
     * 异常码
     */
    private String code;

    /**
     * 异常消息
     */
    private String msg;

    public AppException(String code) {
        this.code = code;
    }

    public AppException(String code, Throwable throwable) {
        this.code = code;
        super.initCause(throwable);
    }

    public AppException(String code, String message) {
        this.code = code;
        this.msg = message;
    }

}
